package net.lcheng.service.impl;

import net.lcheng.dao.PProductAttributeMapper;
import net.lcheng.model.PProductAttribute;
import net.lcheng.model.PProductAttributeExample;

import net.lcheng.service.PProductAttributeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by LV on 2016/7/14.
 */
@Service("pProductAttributeService")
public class PProductAttributeImpl implements PProductAttributeService {
    @Resource
    private PProductAttributeMapper productAttributeMapper;

    @Override
    public List<PProductAttribute> getProductAttributeByIdAndType(String productId, int type) {
        PProductAttributeExample example=new PProductAttributeExample();
        example.createCriteria().andPProductProductIdEqualTo(productId).
                                andAttributeTypeEqualTo(type);
        return productAttributeMapper.selectByExample(example);
    }
}
